<%@page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1" 
	import="Reservation.UserBean,Application.Dao.ReviewDao,DomainData.ReviewBean"%>

<%
	UserBean currentUser = (UserBean) session.getAttribute("currentSessionUser");
%>

   <%
		
		if (currentUser == null) {
			response.sendRedirect("Login.jsp");
			return;
		}
		
		int userID = currentUser.getUserID();
		String content = request.getParameter("comments");
		int rating  = Integer.parseInt(request.getParameter("rating"));
		ReviewBean rb = new ReviewBean(userID, content);
		rb.setRating(rating);
		System.out.println("ID is "+userID+" and content is "+content);
		int key = ReviewDao.insertReview(rb);
		
		out.println(key);
	%>
